import { createAxios, ZAxiosOption } from "@/utils/http";

const serviceGlobalOption: ZAxiosOption = {
  config: {
    baseURL: "/nopig-api",
    timeout: 0,
  },
  fieldConfig: {
    resultField: "data",
  },
  urlPrefix: "/v1",
  trailingTime: false,
  carryToken: false,
  responseCodeConfig: {
    OK: 200,
  },
};

export const nopigHttp = createAxios(serviceGlobalOption);

const request = nopigHttp.request;

export const getKeywordsList = (params: any) =>
  request({
    url: "/pigword/",
    method: "get",
    params,
  });

export const getEvaluationTaskList = (params: any) =>
  request({
    url: "/evaluation_task/",
    method: "get",
    params,
  });

export const getBusinessConfigList = (params: any) =>
  request({
    url: "/business_config/",
    method: "get",
    params,
  });
